package com.chinaoct.siku.util;

import com.chinaoct.siku.vo.UserInfoDTO;

public class UserContext {

    public static ThreadLocal<UserInfoDTO> userInfo = new InheritableThreadLocal();

    public UserContext() {
    }

    public static String getUsername() {
        return ((UserInfoDTO)userInfo.get()).getUsername();
    }

    public static String getToken() {
        return ((UserInfoDTO)userInfo.get()).getToken();
    }

    public static UserInfoDTO getUserInfo() {
        return (UserInfoDTO)userInfo.get();
    }

    public static void setUserInfo(UserInfoDTO userInfoDTO) {
        userInfo.set(userInfoDTO);
    }
}
